// I:\java\estore\estore\service\ProductSorters.java
package com.estore.service;

import com.estore.model.Product;
import java.util.Comparator;

public class ProductSorters {
    public static final Comparator<Product> BY_PRICE_ASC = Comparator.comparing(Product::getPrice);

    public static final Comparator<Product> BY_PRICE_DESC = Comparator.comparing(Product::getPrice).reversed();

    public static final Comparator<Product> BY_STOCK_DESC = Comparator.comparing(Product::getStock).reversed();

    public static final Comparator<Product> BY_NAME = Comparator.comparing(Product::getName);
}
